/**
 * ...
 * @author 
 */

package ;
import bloom.remoting.EncryptedHttpAsyncConnection;


class BackendProxy extends haxe.remoting.AsyncProxy<BackendAPI> {}

class Flash 
{
    public static inline var URL = "php/index.php";
    
    public static function main () {
        
        var cnx = EncryptedHttpAsyncConnection.urlConnect(URL, Crypt.encrypt, Crypt.decrypt);
        
        var proxy = new BackendProxy(cnx.backend);
        
        proxy.getString(function (s) trace("onGetString: " + s));
        
        proxy.hello("amore", function (s) trace("onHello: " + s));
        
        proxy.getObj( function (s) trace("onGetObj: " + s));
        
        proxy.getDBResult(function (s) { trace("onDBResult: " + s); } );
        
        
        
        
        
        /*
        var cb1 = function (s) trace("Queue1: " + Std.string(s));
        var cb2 = function (s) trace("Queue2: " + Std.string(s));
        var cb3 = function (s) trace("Queue3: " + Std.string(s));
        var cb4 = function (s) trace("Queue4: " + Std.string(s));
        var cb5 = function (s) trace("Queue5: " + Std.string(s));
        
        // Remoting Queue
        
        var queue = new RemotingQueue();
        
        queue.addVoid(proxy.getString, cb1);
        queue.addVoid(proxy.getObj, cb2);
        queue.add1(proxy.hello, "amore", cb3);
        queue.addVoid(proxy.getDBResult, cb4);
        queue.add3(proxy.make, "Piet", 1, 18, cb5);
        */
    }
}